<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ taglib prefix = "c"  uri = "http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE HTML>
<html lang="en-US">
<head>
	<meta charset="UTF-8">
	<link rel="stylesheet" type="text/css"  href="css/bootstrap.min.css"/>
	<title>凯胜项目管理系统</title>
	<style type="text/css">
		body{
			padding-top:70px;
		}
	</style>
</head>
<body class="body">
	<%@include file="same2.jsp" %>
	<div class="container">
		<div class="row">
			<%@include file="same.jsp" %>
			<div class="span9" >
				<div class="clear"></div>
				 <ul class="breadcrumb" style="margin-bottom:0px;border-radius: 3px 3px 0 0;margin-top:10px">
					<li class="active">
						<a href="project.html"><i class=" icon-user"></i>联系人</a>
					</li>
				</ul>
				<div class="wall" style="border-top:none; border:1px solid #dddddd ">
					<div style="margin-left:20px">
					<address>
					<img src ="myshow.jspx?id=${singleContact.id }" style = "position:absolute;left:800px;top:150px;z-index:1" />
							<h3>${singleContact.name }</h3>
							<p>${singleContact.company }</p>
							<small>${singleContact.cellphone }
							<small>固话</small> ${singleContact.telphone }<br/><br/>
							<small>邮箱</small> ${singleContact.email }<br/>
							<small>地址</small> ${singleContact.address }<br/><br/>
							<small>主页</small> <a href="${singleContact.mainpage }">${singleContact.mainpage }</a><br/>
							<small>微博</small> <a href="${singleContact.webUrl }">${singleContact.web }</a><br/>
						</address>
						<div class="line">记录      <span id = "myspan"></span></div>
						<form action = "contact.jspx?method=publishRecord" method ="post" id = "myform">
							<textarea name="content" id="myRecord" class="span5" rows="5"></textarea>
							<br/>
							<input type ="button" class="btn" value = "发布">
						</form>
					</div>
					<c:choose>
						<c:when test="${ empty singleContact.list.list}">
							暂时没有记录！
						
						</c:when>
						<c:otherwise>
							<c:forEach items ="${singleContact.list.list}" var = "record">
								<blockquote>
								  ${record.content }
								  <small>${record.user.username }发布于 ${record.createtime }</small>
								</blockquote>
							</c:forEach>
							
						</c:otherwise>
						
					</c:choose>
					<div style="margin:20px"><a href="contact.jspx">←返回联系人列表</a></div>
				</div>
			</div>
		</div>
	</div>	
	<script type="text/javascript" src="js/jquery.js"></script>
	<script type="text/javascript" src="js/bootstrap.min.js"></script>
	<script type="text/javascript">
		$(document).ready(function(){
			$("#myid li").eq(6).addClass("active");
			$("#myid i").eq(4).addClass("  icon-white");
			$(".btn").click(function(){
				var content = $("#myRecord").val();
				if(content.length == 0){
					$("#myspan").html("你发布的内容为空");
					$("#myspan").css("color","red");
					$("#myRecord").focus();	
				}else{
					$("#myform").submit();	
				}
				
				$("#myRecord").keyup(function(){
					$("#myspan").html("");
				});
			
			});
		
		});
		
	</script>
</body>
</html>